package com.solution.admin.order.dao;

import java.util.List;
import java.util.Map;

import com.solution.admin.order.entity.OrderDeliveredBillEntity;
import com.solution.admin.order.entity.OrderDetailEntity;
import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;

/**
 * 订单商品详情DAO接口
 * @author lilp
 * @date 2017-09-15 18:31:33
 */
public interface OrderDetailDao extends BaseDao<OrderDetailEntity> {
	
	/**
	 * 保存订单商品详情
	 * @param orderDetailEntity
	 * @return
	 * @author lilp
	 * @date 2017-09-15 18:31:33
	 */
	public long saveOrderDetail(OrderDetailEntity orderDetailEntity);

	/**
	 * 分页查询订单商品详情信息
	 * @param pageParam 分页对象
	 * @param orderDetail 分页参数
	 * @return PageBean 分页参数及数据
	 * @author lilp
	 * @date 2017-09-15 18:31:33
	 */
	public PageBean listOrderDetailPage(PageParam pageParam, Map<String, Object> param);

	/**
	 * 更新订单商品详情
	 * @param orderDetailEntity
	 * @return
	 * @author lilp
	 * @date 2017-09-15 18:31:33
	 */
	public int updateOrderDetail(OrderDetailEntity orderDetailEntity);


	/**
	 * 删除订单商品详情角色
	 * @param id
	 * @return
	 * @author lilp
	 * @date 2017-09-15 18:31:33
	 */
	public int deleteOrderDetailById(Long id);
	
	/**
	 * 根据订单商品详情类型获取订单商品详情
	 * @param param
	 * @return
	 * @author lilp
	 * @date 2017-09-15 18:31:33
	 */
	public List<OrderDetailEntity> listOrderDetail( Map<String, Object> param);

	/**
	 * 批量修改订单商品调价
	 * @param orderDetailList
	 * @return
	 */
	public int batchAdjustOrderProductPrice(List<OrderDetailEntity> orderDetailList);

	/**
	 * 批量插入订单详情
	 * @param orderDetailList
	 * @return
	 * @author lilp
	 */
	public int saveOrderDetailBatch(List<OrderDetailEntity> orderDetailList);

	/**
	 * 更新订单详情商品已发货数量
	 * @param param1
	 */
	public int updateOrderDetailSendNum(Map<String, Object> param1);

	/**
	 * 查询订单未发货商品数量
	 * @param param
	 * @return
	 */
	public int selectNotDeliveredNum(Map<String, Object> param);

	/**
	 * 修改订单详情表的send_num 字段发货数量 = 购买数量(全部发货)
	 * @param param
	 */
	public int updateOrderDetailSendNumToBuyNum(Map<String, Object> param);
	
}
